\documentclass{article}
\usepackage{graphics}
\usepackage{hyperref} 
\usepackage{url}
\usepackage{underscore}

\title{How to use Model Evaluation tools}
\author{Shuojie Gao\thanks{IAP, LACS, pingf Team}}
\date{2025.08.27}   

\begin{document}

\maketitle  % 把前面的title author date 放到封面里
\tableofcontents  % 生成目录
\newpage

\section{Introduction}  % * 意思是会生成一个不带编号、也不会进入目录的节标题；
Two projects needs me. 
And i was assigned with the Evaluation part, which is required to use the Model Evaluation tools(MET).

MET is a so fucked up software. 
The official tutorial provide little information.
The github page is a solo-dance stage by the developer, providing too much his code updates but very little problem solutions from the community users.
For the reasons above, MET might be a good software in code structure but bad software in its official tutorial.
It is killing frist time users like me. 

When things went wrong, I resorted to
\begin{itemize}
    \item MET official tutorial
    \item github issues
    \item ask claude with online info
    \item read source code, try different config, and turn debug-level to 9 \textbf{(from which i benefit most to make it works)}
\end{itemize}

So i must make a short document to record my experience,
In case i forget in the future, or some kiddo asks me for MET experiences.

I will brief the MET process here. It is a evaluation tool to evaluate the grid/point forecast versus point observation or reanalysis(ERA5,FNL).

\textbf{First, it Preprocess the input data.}
Point observation/forecast need to be processed to MET_point_nc format.
Grid reanalysis/forecast need to follow CF-standard mentioned in official tutorial.

\textbf{Second, design the correct config files and evaluate.}
Normally choose varname, level to evaluate.
If use not-popular observation, config file can be very tricky.
In my case, the little_r format is using the default grib-tables(MET/data/table_files/grib1_dwd_2_78.txt if little_r), which is not shown in the official tutorial.
So i read a lot of source code and  debug info from v-9 debug level. 

\textbf{Third, plot the results.}
One can use the default plot function.
\begin{itemize}
    \item plot_point_obs
    \item plot_data_plane
    \item plot_mode_analysis
\end{itemize}


I do recommend MET for the following reasons:
\begin{itemize}
    \item a lot of metrics, including not easy metrics like \textbf{mode analysis.}
    \item plot functions 
    \item Fast(C++ soft)
    \item Support to common observation formats
\end{itemize}
So you don't have to build the wheels again.
The command syntax is concise and intuitive.



\newpage
\section{point_stat}

\subsection{how to choose level --- config file}
\subsubsection{radiosonde level config}
Z500 500m\\
P500 500hPa
\subsubsection{grid level config}
(0,@850,0,0)    850hPa  \\
(0,@10000,0,0)  10000meter

\subsection{Radiosonde}

I am not familiar with the original radiosonde format.
But many projects need assimilation and Evaluation both, and the assimilation is always earlier than Evaluation.
So the original radiosonde format will frist be Preprocess to other format in order to be assimilated, in my case, little_r for WRFDA.

Though met provides the interface for little_r format, i suggest using the original MET_ascii format.

Little_r format is very constrained. According the official website of Little_r format,\url{https://www2.mmm.ucar.edu/wrf/users/wrfda/OnlineTutorial/Help/littler.html},
it does not specify the name of each column, which means when writing the config file of obs, it is confusing to device the varaible name, which is not 
shown in official tutorial. Second constraintion still comes from the fixed little_r format. Little_r has 11 columns and fixed variables. When other variable that is not 
included in the little_r variable, Met can't evaluate that variable. 

Met_ascii format, as described in \url{https://metplus.readthedocs.io/projects/met/en/latest/Users_Guide/reformat_point.html\#ascii2nc-tool},Table 7.4.
Met_ascii is a very felexble format: for each variable and certrain value there is a single record. User can add any variable they want in it.

MET seems don't provide the vertically interpolation funcion although it claims have. Radiosonde obs need to be vertically interpolated to the 
verification height or pressure. The makes the data preprocess more complex. After the interpolation, execute ascii2nc command. 
\textbf{Note:}I don't see why the official doesn't emphasize that. This is a very easily missed pitfall, cauze why setting the evaluation level, say 850hPa,
the radiosonde may actually have obs of 850hPa because of highly vertically dense observation. \textbf{It might be confusing because when 850hPa works One might think that MET automatically interpolate to the level that User sets}

\subsubsection*{Pesudo codes Usage}
\begin{itemize}
    \item read the original radiosonde file.(User script)
    \item interpolate the radiosonde to the verification height or pressure.(User script)
    \item write the interpolated data to the MET_ascii format. (User script)
    \item execute ascii2nc command. (ascii2nc **.met_ascii pointobs.nc)
    \item pointstat forecast_grid.nc pointobs.nc point_stat_config
\end{itemize}

\subsection*{In my case:}
python little_r_to_met.py obs.2025062300_1  height_interp  test \\
ascii2nc test_height_interp.txt test.nc \\
point_stat /work/home/linjin/combine_run/COMBINE_WORK_ROOT/2025062200/hlev/hlev_linjin_2025062200_024.nc test.nc ../config/point_stat_config_full 


\newpage
\section{grid stat}


\newpage
\section{mode analysis}

\end{document}